{% extends "layout.html" %}
{% block content %}
<div class="main-content">
	<div class="container-fluid" style="padding-bottom:54px">
		<div class="pos-box bgw mtb15">
			<div class="position f14 c9 pull-left"><a class="plr10 c4" href="/">首页</a>/<span class="plr10 c4">面板设置</span></div>
		</div>
		<div class="clearfix bgw mtb15 pd15">
			<div class="safe-port pull-left">
				<div class="ss-text pull-left mr50">
					<em>关闭面板</em>
					<div class="ssh-item">
                        <input class="btswitch btswitch-ios" id="closePl" type="checkbox">
                        <label class="btswitch-btn" for="closePl" onclick="closePanel()"></label>
                    </div>
				</div>
				<div class="ss-text pull-left mr50">
					<em>开发模式</em>
					<div class="ssh-item">
                        <input class="btswitch btswitch-ios" id="debugMode" type="checkbox" {{data['debug']}}>
                        <label class="btswitch-btn" for="debugMode" onclick="debugMode()"></label>
                    </div>
				</div>

				<div class="ss-text pull-left mr50">
                    <em title="开启后允许使用ipv6访问面板">监听IPv6</em>
                    <div class='ssh-item'>
                        <input class='btswitch btswitch-ios' id='panelIPv6' type='checkbox' {{data['ipv6']}}>
                        <label class='btswitch-btn' for='panelIPv6' onclick="setIPv6()"></label>
                    </div>
                </div>
			</div>
		</div>
		<div class="setbox bgw mtb15">
			<div class="title c6 plr15"><h3 class="f16">设置</h3></div>
			<div class="info-title-tips" style="margin: 20px 30px 0px;">
				<p><span class="glyphicon glyphicon-alert" style="color: #f39c12; margin-right: 10px;"></span>为了提高安全,修改面板密码!</p>
			</div>
			<div class="setting-con pd15">
				<form id="set_config">
					<p class="mtb15">
						<span class="set-tit text-right">别名</span>
						<input id="webname" name="webname" class="inputtxt bt-input-text" type="text" value="{{data['title']}}">
						<button type="button" class="btn btn-success btn-sm ml5 btn_webname" disabled>保存</button>
						<span class="set-info c7">面板名称</span>
					</p>

					<p class="mtb15">
						<span class="set-tit text-right" title="服务器IP">服务器IP</span>
						<input name="host_ip" class="inputtxt bt-input-text" type="text" value="{{data['ip']}}">
						<button type="button" class="btn btn-success btn-sm ml5 btn_host_ip" disabled>保存</button>
						<span class="set-info c7">默认为外网IP,若您在本地虚拟机测试,请填写虚拟机内网IP!</span>
					</p>

					<p class="mtb15">
						<span class="set-tit text-right">面板端口</span>
						<input id="banport" name="port" class="inputtxt bt-input-text" type="numner" value="{{data['port']}}" maxlength="5">
						<button type="button" class="btn btn-success btn-sm ml5 btn_port" disabled>保存</button>
						<span class="set-info c7">建议端口范围7200 - 65535</span>
					</p>

					<p class="mtb15">
						<span class="set-tit text-right">安全入口</span>
						<input id="admin_path" name="admin_path" class="inputtxt bt-input-text disable" type="text" value="{{data['admin_path']}}">
						<button type="button" class="btn btn-success btn-sm ml5" onclick="modifyAuthPath()">设置</button>
						<span class="set-info c7">面板管理入口,设置后只能通过指定安全入口登录面板,如: /abc</span>
					</p>

					<p class="mtb15">
						<span class="set-tit text-right" title="默认建站目录">默认建站目录</span>
						<input name="sites_path" class="inputtxt bt-input-text" type="text" value="{{data['site_path']}}">
						<button type="button" class="btn btn-success btn-sm ml5 btn_sites_path" disabled>保存</button>
						<span class="set-info c7">新创建的站点,默认将保存到该目录的下级目录!</span>
					</p>

					<p class="mtb15">
						<span class="set-tit text-right" title="默认建站目录">默认备份目录</span>
						<input name="backup_path" class="inputtxt bt-input-text" type="text" value="{{data['backup_path']}}">
						<button type="button" class="btn btn-success btn-sm ml5 btn_backup_path" disabled>保存</button>
						<span class="set-info c7">网站和数据库的备份目录!</span>
					</p>

					<p class="mtb15">
						<span class="set-tit text-right" title="服务器时间">服务器时间</span>
						<input id="systemdate" name="systemdate" class="inputtxt bt-input-text disable" type="text" value="{{data['systemdate']}}">
						<button type="button" class="btn btn-success btn-sm ml5" onclick="syncDate()">同步</button>
						<span class="set-info c7">同步当前服务器时间</span>
					</p>
					<p class="mtb15">
						<span class="set-tit text-right" title="面板用户">面板用户</span>
						<input name="username_" class="inputtxt bt-input-text disable" type="text" value="{{data['username']}}" disabled>
						<button type="button" class="btn btn-success btn-sm ml5" onclick="setUserName()">设置</button>
						<span class="set-info c7">设置面板账号</span>
					</p>
					<p class="mtb15">
						<span class="set-tit text-right" title="面板密码">面板密码</span>
						<input name="password_" class="inputtxt bt-input-text disable" type="text" value="******" disabled>
						<button type="button" class="btn btn-success btn-sm ml5" onclick="setPassword()">设置</button>
						<span class="set-info c7">设置面板密码</span>
					</p>
				</form>
			</div>

			<div class="title c6 plr15"><h3 class="f16">安全</h3></div>
			<div class="setting-con pd15">

				<p class="mtb15">
					<span class="set-tit text-right" title="绑定域名" style="float: left;">绑定域名</span>
						<input name="bind_domain" class="inputtxt bt-input-text" type="text" value="{{data['bind_domain']}}">
	                <button type="button" class="btn btn-success btn-sm ml5 btn_bind_domain" disabled>保存</button>
					<span class="set-info c7">为面板绑定一个访问域名，<b style="color: red;">注意：一旦绑定域名，只能通过域名访问面板</b></span>
				</p>

				<p class="mtb15">
					<span class="set-tit text-right" title="面板SSL" style="float: left;">面板SSL</span>
						<input id="cfg_ssl" name="bind_ssl" class="btswitch btswitch-ios" type="checkbox" {{data['ssl']}}>
						<label class="btswitch-btn ml5" for="cfg_ssl" style="float: left;margin-top:4px;"></label>
	                <button ype="button" class="btn btn-default btn-xs panel_api_btn" style="vertical-align: middle; margin-left: 10px" onclick="getPanelSSL();">面板SSL配置</button>
					<span class="set-info c7">为面板设置https协议访问，提升面板访问<b style="color: red;">安全性</b></span>
				</p>

				<p class="mtb15">
					<span class="set-tit text-right" title="BasicAuth认证" style="float: left;">BasicAuth认证</span>
						<input class="btswitch btswitch-ios" id="cfg_basic_auth" type="checkbox" {{data['basic_auth']}}/>
	                <label class="btswitch-btn ml5" for="cfg_basic_auth" style="float: left;margin-top:4px;" onclick="setBasicAuth()"></label>
					<span class="set-info c7">为面板增加一道基于BasicAuth的认证服务，有效防止面板被扫描</span>
				</p>

				<p class="mtb15">
					<span class="set-tit text-right" title="API接口" style="float: left;">API接口</span>
						<input class="btswitch btswitch-ios" id="cfg_panel_api" type="checkbox" {{data['api_token']}}/>
	                <label class="btswitch-btn ml5" for="cfg_panel_api" style="float: left;margin-top:4px;" onclick="setPanelApi()"></label>
	                <button ype="button" class="btn btn-default btn-xs panel_api_btn" style="vertical-align: middle; margin-left: 10px" onclick="showPanelApi();">API接口配置</button>
					<span class="set-info c7">提供面板API接口访问的支持</span>
				</p>

				<p class="mtb15">
					<span class="set-tit text-right" title="未认证响应状态">未认证响应状态</span>
					<input name="status_code" class="inputtxt bt-input-text disable" type="text" value="{{data['status_code_msg']}}" disabled>
					<button type="button" class="btn btn-success btn-sm ml5" data-code="{{data['status_code']}}" onclick="setStatusCode(this)">设置</button>
					<span class="set-info c7">用于在未登录且未正确输入安全入口时的响应，可用于隐藏面板特征</span>
				</p>

				<p class="mtb15">
					<span class="set-tit text-right" title="临时访问授权">临时访问授权</span>
					<button type="button" class="btn btn-success btn-sm ml5" onclick="setTempAccess()">临时访问授权管理</button>
					<span class="set-info c7">为非管理员临时提供面板访问权限</span>
				</p>
			</div>


			<div class="title c6 plr15"><h3 class="f16">通知</h3></div>

			<div class="setting-con pd15">

				<p class="mtb15">
					<span class="set-tit text-right" title="TelegramBot" style="float: left;">TG机器人通知</span>
						<input id="cfg_tgbot" name="cfg_tgbot" onclick="setNotifyApi('tgbot',this)" class="btswitch btswitch-ios" type="checkbox" {{data['notify_tgbot_enable']}}>
						<label class="btswitch-btn ml5" for="cfg_tgbot" style="float: left;margin-top:4px;"></label>
	                <button ype="button" class="btn btn-default btn-xs panel_api_btn" style="vertical-align: middle; margin-left: 10px" onclick="getTgbot();">TelegramBot配置</button>
					<span class="set-info c7">Telegram Bot机器人通知【<b style="color:red;">国内可能无法使用</b>】</span>
				</p>

				<p class="mtb15">
					<span class="set-tit text-right" title="绑定账号" style="float: left;">邮件通知</span>
						<input id="cfg_email" name="cfg_email" onclick="setNotifyApi('email',this)" class="btswitch btswitch-ios" type="checkbox" {{data['notify_email_enable']}}>
						<label class="btswitch-btn ml5" for="cfg_email" style="float: left;margin-top:4px;"></label>
	                <button ype="button" class="btn btn-default btn-xs panel_api_btn" style="vertical-align: middle; margin-left: 10px" onclick="getEmailCfg();">邮件配置</button>
					<span class="set-info c7">邮件通知</span>
				</p>

			</div>

			<!-- <div class="title c6 plr15"><h3 class="f16">VIP</h3></div>
			<div class="setting-con pd15">
				<p class="mtb15">
					<span class="set-tit text-right" title="用户登录" style="float: left;">用户登录</span>
						<input id="cfg_login" name="cfg_login" onclick="" class="btswitch btswitch-ios" type="checkbox" disabled>
						<label class="btswitch-btn ml5" for="cfg_login" style="float: left;margin-top:4px;"></label>
	                <button ype="button" class="btn btn-default btn-xs" style="vertical-align: middle; margin-left: 10px" onclick="setVipInfo();">绑定</button>
					<span class="set-info c7">【<b style="color:red;">请勿使用</b>】测试版(开发中)</span>
				</p>
			</div> -->
		</div>
	</div>
</div>
<script src="/static/app/config.js?v={{config.version}}"></script>
{% endblock %}